import direct.directbase.DirectStart #starts Panda
from panda3d.core import Spotlight #used for headlight
from pandac.PandaModules import * #basic Panda modules
from direct.showbase.DirectObject import DirectObject #for event handling
from direct.actor.Actor import Actor #for animated models
from direct.interval.IntervalGlobal import * #for compound intervals
from direct.task import Task #for update functions
from direct.showbase import Audio3DManager #Needed to implement 3D effects for the cars
from panda3d.core import PointLight,Spotlight
import sys, math, random

keyMap = {"leftA":0,"rightA":0,"forwardA":0,"brakeA":0,"fireA":0,
          "leftB":0,"rightB":0,"forwardB":0,"brakeB":0,"fireB":0,
          "leftC":0,"rightC":0,"forwardC":0,"brakeC":0,"fireC":0,
          "leftD":0,"rightD":0,"forwardD":0,"brakeD":0,"fireD":0,
          "enter":0}

#carMap = {"caveman":0,"knight":2,"pirate":3,"viking":4}
numRacers = 3
carA = "pirate"
carB = "viking"
carC = "caveman"
carD = "knight"

noRacer = False

#Sound management
audio3d = Audio3DManager.Audio3DManager(base.sfxManagerList[0], camera)

allEntities = []

maxVel = 1.0

def setKey(self, key, value):
    keyMap[key] = value
